"""全局样式定义"""

# 喜马拉雅主色系
XM_PRIMARY = "#FF6A00"
XM_PRIMARY_DARK = "#FF8C1A"
XM_BG = "#F7F8FA"
XM_CARD = "#FFFFFF"
XM_TEXT = "#222222"
XM_TEXT_SECONDARY = "#666666"
XM_DIVIDER = "#EDEDED"

# 主窗口样式
MAIN_WINDOW_STYLE = f"""
QMainWindow {{
    background-color: {XM_BG};
}}
"""

# 导航面板样式
NAV_PANEL_STYLE = f"""
QWidget {{
    background-color: {XM_CARD};
    border-right: 1px solid {XM_DIVIDER};
}}
QPushButton {{
    background-color: transparent;
    border: none;
    color: {XM_TEXT_SECONDARY};
    padding: 14px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
}}
QPushButton:hover, QPushButton:checked {{
    background-color: #FFF3E6;
    color: {XM_PRIMARY};
}}
"""

# 内容区域样式
CONTENT_AREA_STYLE = """
QTabWidget::pane {
    border: none;
    background-color: #f5f6fa;
}

QTabBar::tab {
    background-color: #ffffff;
    color: #4a5568;
    padding: 10px 20px;
    border: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-weight: 500;
}

QTabBar::tab:selected {
    background-color: #ebf4ff;
    color: #2b6cb0;
}

QTabBar::tab:hover:!selected {
    background-color: #f7fafc;
}
"""

# 菜单栏样式
MENU_BAR_STYLE = """
QMenuBar {
    background-color: #ffffff;
    color: #2d3748;
    border-bottom: 1px solid #e5e9f7;
}

QMenuBar::item {
    padding: 6px 12px;
    font-weight: 500;
}

QMenuBar::item:selected {
    background-color: #ebf4ff;
    color: #2b6cb0;
}

QMenu {
    background-color: #ffffff;
    color: #2d3748;
    border: 1px solid #e5e9f7;
    border-radius: 6px;
    padding: 4px;
}

QMenu::item {
    padding: 8px 32px 8px 24px;
    border-radius: 4px;
}

QMenu::item:selected {
    background-color: #ebf4ff;
    color: #2b6cb0;
}
"""

# 工具栏样式
TOOL_BAR_STYLE = """
QToolBar {
    background-color: #ffffff;
    border: none;
    border-bottom: 1px solid #e5e9f7;
    spacing: 8px;
    padding: 4px;
}

QToolButton {
    background-color: transparent;
    border: none;
    padding: 6px;
    border-radius: 4px;
}

QToolButton:hover {
    background-color: #ebf4ff;
}
"""

# 状态栏样式
STATUS_BAR_STYLE = """
QStatusBar {
    background-color: #ffffff;
    color: #4a5568;
    border-top: 1px solid #e5e9f7;
    padding: 4px 8px;
}
"""

# 按钮样式
BUTTON_STYLE = f"""
QPushButton {{
    background-color: {XM_PRIMARY};
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 500;
}}
QPushButton:hover {{
    background-color: {XM_PRIMARY_DARK};
}}
QPushButton:disabled {{
    background-color: #FFD2A6;
    color: #fff;
}}
"""

# 输入框样式
INPUT_STYLE = f"""
QLineEdit, QTextEdit {{
    background-color: #fff;
    color: {XM_TEXT};
    border: 1.5px solid {XM_DIVIDER};
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 15px;
}}
QLineEdit:focus, QTextEdit:focus {{
    border: 1.5px solid {XM_PRIMARY};
    background-color: #FFF3E6;
}}
"""

# 标签样式
LABEL_STYLE = f"""
QLabel {{
    color: {XM_TEXT};
    font-size: 15px;
}}
QLabel[class="section-title"] {{
    font-size: 18px;
    font-weight: bold;
    color: {XM_PRIMARY};
    padding: 6px 0;
}}
"""

# 进度条样式
PROGRESS_BAR_STYLE = f"""
QProgressBar {{
    background-color: #fff;
    border: 1.5px solid {XM_DIVIDER};
    border-radius: 8px;
    text-align: center;
    color: {XM_TEXT};
    font-size: 13px;
    padding: 2px;
}}
QProgressBar::chunk {{
    background-color: {XM_PRIMARY};
    border-radius: 8px;
}}
"""

# 滚动条样式
SCROLL_BAR_STYLE = f"""
QScrollBar:vertical {{
    background-color: #fff;
    width: 16px;
    border: none;
}}
QScrollBar::handle:vertical {{
    background-color: #FFD2A6;
    min-height: 40px;
    border-radius: 8px;
    margin: 2px;
}}
QScrollBar::handle:vertical:hover {{
    background-color: {XM_PRIMARY};
}}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {{
    height: 0px;
}}
QScrollBar:horizontal {{
    background-color: #fff;
    height: 16px;
    border: none;
}}
QScrollBar::handle:horizontal {{
    background-color: #FFD2A6;
    min-width: 40px;
    border-radius: 8px;
    margin: 2px;
}}
QScrollBar::handle:horizontal:hover {{
    background-color: {XM_PRIMARY};
}}
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {{
    width: 0px;
}}
"""

# 分组框样式
GROUP_BOX_STYLE = f"""
QGroupBox, QFrame {{
    background-color: {XM_CARD};
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 12px rgba(255,106,0,0.08);
    padding: 20px;
}}
QGroupBox::title {{
    subcontrol-origin: margin;
    subcontrol-position: top left;
    padding: 0 12px;
    color: {XM_PRIMARY};
    font-size: 16px;
    font-weight: bold;
}}
"""

# 下拉框样式
COMBO_BOX_STYLE = f"""
QComboBox {{
    background: #fff;
    color: {XM_TEXT};
    border: 1.5px solid {XM_PRIMARY};
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 15px;
    min-width: 180px;
    outline: none;
}}
QComboBox:focus, QComboBox:active, QComboBox:hover {{
    border: 1.5px solid {XM_PRIMARY_DARK};
    background: #fff;
    color: {XM_TEXT};
}}
QComboBox:disabled {{
    background: #f5f6fa;
    color: #bbb;
    border: 1.5px solid #eee;
}}
QComboBox::drop-down {{
    border: none;
    background: transparent;
}}
QComboBox::down-arrow {{
    image: none;
    border: none;
    width: 18px;
    height: 18px;
}}
QComboBox QAbstractItemView, QComboBox QListView, QListView {{
    background: #fff;
    color: {XM_TEXT};
    border-radius: 8px;
    font-size: 15px;
    selection-background-color: #FFF3E6;
    selection-color: {XM_PRIMARY};
}}
QListView::item, QComboBox QAbstractItemView::item, QComboBox QListView::item {{
    color: {XM_TEXT};
    min-height: 36px;
    padding: 0 16px;
    margin: 0;
    border-radius: 4px;
    background: #fff;
}}
QListView::item:selected, QComboBox QAbstractItemView::item:selected, QComboBox QListView::item:selected {{
    background: #FFF3E6;
    color: {XM_PRIMARY};
}}
QListView::item:hover, QComboBox QAbstractItemView::item:hover, QComboBox QListView::item:hover {{
    background: #F7F8FA;
    color: {XM_PRIMARY_DARK};
}}
"""

# 复选框样式
CHECK_BOX_STYLE = f"""
QCheckBox {{
    color: {XM_TEXT};
    spacing: 10px;
    font-size: 15px;
}}
QCheckBox::indicator {{
    width: 20px;
    height: 20px;
    border: 1.5px solid {XM_DIVIDER};
    border-radius: 6px;
    background-color: #fff;
}}
QCheckBox::indicator:checked {{
    background-color: {XM_PRIMARY};
    border: 1.5px solid {XM_PRIMARY};
}}
"""

# 消息框样式
MESSAGEBOX_STYLE = f"""
QMessageBox {{
    background-color: #fff;
}}
QMessageBox QLabel {{
    color: {XM_TEXT};
    font-size: 15px;
    padding: 10px;
}}
QMessageBox QPushButton {{
    background-color: {XM_PRIMARY};
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 24px;
    font-size: 15px;
    font-weight: 500;
}}
QMessageBox QPushButton:hover {{
    background-color: {XM_PRIMARY_DARK};
}}
"""

# 列表样式
LIST_WIDGET_STYLE = f"""
QListWidget {{
    background-color: #fff;
    border: 1.5px solid {XM_DIVIDER};
    border-radius: 8px;
    padding: 6px;
}}
QListWidget::item {{
    color: {XM_TEXT};
    padding: 10px;
    border-radius: 6px;
}}
QListWidget::item:selected {{
    background-color: #FFF3E6;
    color: {XM_PRIMARY};
}}
QListWidget::item:hover:!selected {{
    background-color: #FFF3E6;
}}
"""

SECTION_TITLE_STYLE = """
QLabel[class="section-title"] {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    padding: 4px 0;
}
""" 